<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>封装 axios</title>
</head>
<body>
<div id="app">

</div>

<script src="../../../../js/axios.js"></script>
<script type="module">
    import {createApp, onMounted} from "../../../../js/vue.esm-browser.js";
    import {getRequest, postRequest} from "./request.js";

    let app = createApp({
        setup() {
            onMounted(() => {
                getRequest(
                    "/get",
                    {
                        params: {
                            name: "abcque",
                            age: 18,
                            gender: "M",
                        }
                    }
                ).then(res => {
                    console.log(res);
                })

                postRequest(
                    "/post",
                    {
                        name: "abcque",
                        age: 18,
                        gender: "M",
                    }
                ).then(res => {
                    console.log(res);
                })

            })

            return {}
        }
    })

    app.mount("#app")
</script>
</body>
</html>